
local Msg = require("core.Msg")
local Obj = require("core.Obj")
local EffectLogic = require("scene.EffectLogic")

display_list = display_list or {}

function create(area_id, body_id)
	if not body_id then
		assert()
	end
	local display = {}
	Obj.create(display, Obj.TYPE_DISPLAY)
	display.area_id = area_id
	display.body_id = body_id
	if display_list[display.id] then
		assert()
	end
	display_list[display.id] = display
	return display
end

function destroy(display)
	if not display_list[display.id] then
		assert()
	end
	display_list[display.id] = nil
	display.die = 1
	Obj.destroy(display)
end

function getObjAdd(display)
	local mm = Msg.gc.GC_ADD_DISPLAY
	mm.obj_id = display.id
	mm.body_id = display.body_id
	mm.x = display.x
	mm.y = display.y
	mm.effectConfig = EffectLogic.getConfig(display.body_id)
	mm.name = display.name or ""
	return mm
end
